﻿using System;

namespace XTengine.ComponentModel
{
    public class SByteConverter : TypeConverter<SByte>
    {
        public override SByte ConvertFrom(string value)
        {
            SByte result;
            if (SByte.TryParse(value, out result))
            {
                return result;
            }

            return 0;
        }

        public override string ConvertTo(SByte value)
        {
            return value.ToString();
        }
    }
}